CSE 16: Applied Discrete Mathematics
Instructor: Owen Arden
Winter 2023
Simple proofs
Direct proofs
Indirect proofs
Proof by cases
Problem: what if there are an infinite number of cases?
Theorem: For every positive integer \(n\), \[\sum_{j=1}^{n} j = \dfrac{n(n+1)}{2}\]
Proof.
\[\begin{align} 1 &= \dfrac{1(1+1)}{2} \\ 1 &= \dfrac{2}{2} \ \\ 1 &= 1 \end{align}\]
How can we prove properties about an infinite number of cases using a finite number of steps?
We couldn’t effectively split up the natural numbers into finite cases since each \(n=1\) gives a slightly different sum.
We need a way to prove the cases more abstractly so they apply to all numbers.
Induction is a powerful proof technique that is particularly useful for proving statements about elements in a sequence.
Suppose we want to prove \(P(n)\) for all natural numbers \(n\). There are two components of an inductive proof:
The base case establishes that the theorem is true for the first or “least” value in the sequence. (\(n=1\))
The inductive step establishes that if the the theorem is true for \(n=k\), then it also holds for \(n=k+1\).
Theorem (Division algorithm): If \(a\) is an integer and \(d\) is a positive integer, then there are unique integers \(q\) and \(r\) with \(0 \leq r \lt d\) such that \(a = dq + r\).
Proof. Let \(S\) be the set of nonnegative integers of the form \(a - dq\), where \(q\) is an integer. The set is nonempty since we can make \(dq\) as small or large as necessary.
Since any subset of non-negative integers is well ordered, \(S\) has a least element \(r = a - dq_0\). Since \(r \in S\), it is non-negative. Also, \(r < d\), since otherwise there would be a smaller non-negative element in \(S\): \[a - d(q_0 + 1) = a - dq_0 - d = r - d > 0\]
Therefore, there are unique integers \(q\) and \(r\) with \(0 \leq r \lt d\). \(\square\)
Mathematical induction is an inference rule that is valid because of the well-ordering property.
Theorem (Mathematical induction): \(P(n)\) is a statement parameterized by a positive integer \(n\). \[(P(1) \wedge \forall k. P(k) \to P(k+1)) \to \forall n. P(n)\] where the domain of \(k\) is the positive integers.
In other words, if you prove \(P(1)\) and \(P(k) \to P(k+1)\), then \(P(n)\) is true for all \(n\).
Suppose \(P(1)\) and \((P(k) \to P(k+1)\) for all \(k \in \mathbb{Z}^{+}\).
Assume for contradiction there is at least one positive integer \(n\) such that \(P(n)\) is false. Let \(S\) be the set of all positive integers \(x\) where \(\neg P(x)\). Then \(S\) is non-empty since \(n \in S\).
Since \(\mathbb{Z}^{+}\) is well-ordered, \(S\) has a least element we will call \(m\).
Since \(P(1)\) is true by assumption, \(m \neq 1\).
Since \(m\) is positive and greater than \(1\), \(m-1\) is a positive integer.
Since \(m\) is the least element of \(S\), \(m-1 \not\in S\), so \(P(m-1)\) is true.
But since \(P(k) \to P(k+1)\) is true (by assumption), \(P(m-1)\) implies \(P(m)\), a contradiction.
Therefore \(P(n)\) is true for all \(n \in \mathbb{Z}^{+}\).\(\square\)
Theorem: For every positive integer \(n\), \[\sum_{j=1}^{n} j = \dfrac{n(n+1)}{2}\]
Proof. We prove the theorem by induction on \(n\).
Theorem: For every positive integer \(n\), \[\sum_{j=1}^{n} j = \dfrac{n(n+1)}{2}\]
Proof. We prove the theorem by induction on \(n\).
\[\begin{align} \sum_{j=1}^{k+1} j &= \sum_{j=1}^{k} j + (k+1) & \qquad \text{defn. of summ.} \\ &= \dfrac{k(k+1)}{2} + (k+1) & \qquad \text{by inductive hyp.} \\ &= \dfrac{k(k+1)+ 2(k+1)}{2} & \qquad \text{by algebra} \\ &= \dfrac{(k+2)(k+1)}{2} & \qquad \text{by algebra} \end{align}\]
Theorem: For every positive integer \(n\), \(n \lt 2^{n}\).
Proof.
Base case \((n=1)\): True since \(1 < 2^{1} = 2\).
Inductive step:
Therefore, \(n \lt 2^{n}\) holds for all positive integers \(n\).\(\square\)
Theorem: Suppose \(S\) is a finite set with \(n\) elements, where \(n\) is a non-negative integer. Then \(S\) have \(2^{n}\) subsets.
Proof.
Base case \((n=0)\): True since the empty set has only itself as a subset and \(2^0=1\).
Inductive step: Let \(S\) have \(k\) elements (\(|S|=k\)).
What if the induction hypothesis isn’t enough?
Consider the Fibonacci sequence, where \(f_0=0, f_1=1\) and for \(n \geq 2\): \[f_n = f_{n-1} + f_{n-2}\] Prove that \(f_n \leq 2^{n}\) for all \(n\).
Theorem (Strong induction): \(P(n)\) is a statement parameterized by a positive integer \(n\). Let \(a \leq b\) be integers. Then \(P(n)\) is true for all \(n \geq a\), if:
Consider the Fibonacci sequence, where \(f_0=0, f_1=1\) and for \(n \geq 2\): \[f_n = f_{n-1} + f_{n-2}\] Prove that \(f_n \leq 2^{n}\) for all \(n\).
Fibonacci numbers are an example of recursively or inductively defined functions. These definitions share some structure with inductive proofs:
Example: Suppose \(f(0)=3\) and \(f(n+1) = 2*f(n)+3\). Find \(f(4)\).
Solution: \[\begin{align} f(4) &= 2*f(3) + 3 = 2*45 + 3 = 93 \\ f(3) &= 2*f(2) + 3 = 2*21 + 3 = 45 \\ f(2) &= 2*f(1) + 3 = 2*9+3 = 21 \\ f(1) &= 2*f(0) + 3 = 9 \end{align}\]
Example: Define \(S\) to be a subset of the integers as:
What are some elements of \(S\)?
\(3, 6, 9\) etc.
Example: The natural numbers \(\mathbb{N}\).
We can also define other structures recursively.
Example: If \(\Sigma = \{0,1\}\), then \(\Sigma^{*}\) is the set of all binary strings: \(\lambda, 0, 1, 00,01,10,11\), etc.
Example: If \(\Sigma = \{a,b\}\), show that \(aab\) is in \(\Sigma^{*}\).
To specify functions on inductive structures (like strings), we also use inductive definitions:
Define \(B=\{0,1\}\) and let \(B^{*}\) be the set of all strings over \(B\). The length of a string \(w \in B^{*}\), written \(|w|\), is defined as:
Let \(\mathcal{F}\) be the set of well-formed formulae in propositional logic, involving \(\text{T}\), \(\text{F}\), propositional variables, and operators \(\neg,\wedge,\vee,\to,\leftrightarrow\).
An inductive definition of rooted trees:
An inductive definition of full binary trees: